package com.lyy.consolidate.homework4;


/**
 * @Author:  GZQ
 * @date:  2024/12/1 23:37
 * @description: 巩固练习4
 */

class Teacher extends Employee{

    // 特有属性
    // (2)教师除基本工资外,还有课酬(元/天) classDay, classSal
    private double classDay;  // 一年上课次数
    private double classSal;  // 课时费

    public Teacher(String name, double sal) {
        super(name, sal);
    }

    public double getClassDay() {
        return classDay;
    }

    public void setClassDay(double classDay) {
        this.classDay = classDay;
    }

    public double getClassSal() {
        return classSal;
    }

    public void setClassSal(double classSal) {
        this.classSal = classSal;
    }

    // 方法重写
    @Override
    public void printSalary() { // 老师不能使用super.printSalary()
        System.out.print("老师 ");
        System.out.println(getName() + " 年工资是 " + (getSal() * getSalMonth() + classSal * classDay));
    }
}
